#ifndef _GLITCHFILTER_H_
#define _GLITCHFILTER_H_
#include "stdint.h"
typedef struct
{
	uint16_t time;             //当前时间
	uint16_t filter_time;      //滤波阈值时间
	uint32_t out_value;       //滤波器输出状态
	uint32_t last_value;   //上次输入状态
}Glitch_Filter_t;

uint8_t GlitchFilter_Value(Glitch_Filter_t *filter,uint32_t value,uint8_t time);    //获取滤波值
uint8_t Register_GlitchFilter(Glitch_Filter_t *filter,uint16_t filter_time);        //注册滤波器
#endif